package com.mybpm.core.definition

import com.easecurity.util.JsonUtils
import grails.compiler.GrailsCompileStatic
import groovy.transform.ToString

/**
 * 流程定义
 */
@GrailsCompileStatic
@ToString(includes = 'id,name', includeNames = true, includePackage = false)
class Process {
    /** 流程id */
    String pid
    /** 流程定义名称 */
    String name
    /** 流程显示名称 */
    String displayName
    /** 流程类型 */
    String type
    /** 版本号：三段式(xxx.xxx.xxx) */
    String revision
    /** 流程简要说明 */
    String description
    /** XML文件 */
    String xml
    /** signavioXml文件 */
    String signavioXml
    /** 流程定义是否被禁用 */
    Boolean disabled = Boolean.FALSE

    Date dateCreated;
    Date lastUpdated;

    static constraints = {
        pid nullable: false, blank: false, length: 200
        name nullable: false, blank: false, length: 100
        displayName nullable: true, length: 100
        type nullable: true, length: 50
        revision nullable: true, length: 50
        description nullable: true, length: 4000
        xml nullable: true
        signavioXml nullable: true
    }

    static mapping = {
        table 'bpm_d_process'
        xml type: "text"
        signavioXml type: "text"
        version false
    }

}
